/*
 * Blink
 * Turns on an LED on for one second,
 * then off for one second, repeatedly.
 */

#include <Arduino.h>

#define LED_PIN 1
#define LED(x) digitalWrite(LED_PIN, x)
#define LED_TOGGLE() digitalWrite(LED_PIN, !digitalRead(LED_PIN))

int baud = 115200;

void setup()
{
  // initialize LED digital pin as an output.
  pinMode(LED_PIN, OUTPUT);

  Serial.begin(baud);

  Serial.printf("Deafult free size: %d\n", heap_caps_get_free_size(MALLOC_CAP_DEFAULT));
  Serial.printf("PSRAM free size: %d\n", heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
  Serial.printf("Flash size: %d bytes\n", ESP.getFlashChipSize());
}

void loop()
{
  // 低电平 开灯
  LED(LOW);

  Serial.println("  turn on");

  delay(1000);

  LED_TOGGLE();

  Serial.println("  关灯");

  delay(3000);
}
